package com.zhang.cn.ScheduledTasks;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@EnableScheduling
@Component
@EnableAutoConfiguration
public class userScheduledTasks {
//private static final SimpleDateFormat dateFormat=new  SimpleDateFormat("HH:mm:ss");
//@Scheduled(fixedRate = 5000)
//public void Currentime(){
//System.err.println("现在时间"+dateFormat.format(new Date()));	
//}
	@Scheduled(fixedRate = 5000)
	public void testScheduledTasks(){
		System.out.println("我被任务调度了");
		
	}
public static void main(String[] args) {
	SpringApplication.run(userScheduledTasks.class, args);
}
}
